<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<RMH.Entities.Patient>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Patients
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Patients</h2>

    <table>
        <thead>
        <tr>
            <th></th>
            <th>
                Last Name
            </th>
            <th>
                First Name
            </th>
             <th>
                Middle Name
            </th>
            <th>
                Date of Birth
            </th>
            <th>
                Email Address
            </th>
            <th>
                Phone Number
            </th>
        </tr>
        </thead>
        <tbody>
    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink("Edit", "Edit", new { id = item.Id })%> |
                <%= Html.ActionLink("Details", "Details", new { id=item.Id })%> |
                <%= Html.ActionLink("Add Stay", "New", "Stay", new { id=item.Id }, null)%> |
                <%= Html.ActionLink("Add Notes", "Notes", new { id=item.Id })%>
            </td>
            <td>
                <%= Html.Encode(item.LastName) %>
            </td>
            <td>
                <%= Html.Encode(item.FirstName) %>
            </td>
            <td>
                <%= Html.Encode(item.MiddleName) %>
            </td>
            <td>
                <%= Html.Encode(String.Format("{0:d}", item.DateOfBirth))%>
            </td>
            <td>
                <%= Html.Encode(item.EmailAddress) %>
            </td>
            <td>
                <%= Html.Encode(item.PhoneNumber) %>
            </td>
        </tr>
    
    <% } %>
        </tbody>
    </table>

    <p>
        <%= Html.ActionLink("Create New", "Edit") %>
    </p>

</asp:Content>

